package data;

import org.codehaus.jackson.map.ObjectMapper;

import java.util.Random;

public class VehicleDataProducer {
    private static final String TOPIC = "vehicle_realtime";
    private static final String BOOTSTRAP_SERVERS = "node101:9092";

    private static final Random random = new Random();
    private static final ObjectMapper mapper = new ObjectMapper();

    private static final String VIN_PREFIX = "LJW"; // 固定前缀
    private static final int VIN_LENGTH = 17;
    private static final long START = 1;   // 范围起始
    private static final long END = 10000;   // 范围结束（比如 100 辆车）

    // VIN 范围生成方法
    private static String generateVinInRange() {
        long number = START + random.nextInt((int) (END - START + 1));
        String numberStr = String.format("%0" + (VIN_LENGTH - VIN_PREFIX.length()) + "d", number);
        return VIN_PREFIX + numberStr;
    }
}
